package com.kedi.usercenter.pclogin.service.impl;

import com.kedi.usercenter.pclogin.mapper.AdminLoginMapper;
import com.kedi.usercenter.pclogin.service.AdminLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 管理员登录服务实现类
 */
@Service
public class AdminLoginServiceImpl implements AdminLoginService {


    @Autowired
    private AdminLoginMapper mapper;

    /**
     * PC端管理员用户登录
     * @param loginName 登录名称
     * @param password 密码
     * @return
     */
    @Override
    public Map<String, Object> getAdminLoginInfo(String loginName, String password) {
        try {
            Map<String, Object> map = mapper.selectByNameAndPs(password, loginName);
            if(map != null  && !map.isEmpty()){
                return map;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return null;
    }
}
